﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WFNetLib.MyControls;

namespace 教室客户端
{
    public partial class Form2 : Form
    {
        public Form2(JSON_ExperimentData[] Experiments)
        {
            InitializeComponent();
            comboBox1.Items.Clear();
            if (Experiments.Length == 0)
            {
                MessageBox.Show("没有实验信息");
            }
            else
            {
                foreach (JSON_ExperimentData ex in Experiments)
                {
                    comboBox1.Items.Add(new wfComboBoxItem(ex.Name, ex));
                }
            }            
            comboBox1.SelectedIndex = 0;
        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }
        public JSON_ExperimentData curEX = null;
        private void button1_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(comboBox1.Text))
            {
                curEX = (JSON_ExperimentData)((wfComboBoxItem)comboBox1.SelectedItem).Value;
                this.DialogResult = DialogResult.OK;
            }
        }
    }
}
